package com.sgj.factory.factorymethod.pizzastore.order;

import com.sgj.factory.factorymethod.pizzastore.pizza.BJChesssePizza;
import com.sgj.factory.factorymethod.pizzastore.pizza.BJPepperPizza;
import com.sgj.factory.factorymethod.pizzastore.pizza.Pizza;

/**
 * 工厂方法模式
 * @Author: Guoji Shen
 * @Date: 2021/11/12 9:28
 */
public class BJOrderPizza extends OrderPizza{

    @Override
    Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equalsIgnoreCase("cheese")) {
            pizza = new BJChesssePizza();
        } else if (orderType.equalsIgnoreCase("pepper")) {
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}